/*     */ package com.dvnchina.boss;
/*     */ 
/*     */ import java.io.BufferedReader;
/*     */ import java.io.BufferedWriter;
/*     */ import java.io.File;
/*     */ import java.io.FileNotFoundException;
/*     */ import java.io.FileReader;
/*     */ import java.io.FileWriter;
/*     */ import java.io.IOException;
/*     */ import java.io.PrintStream;
/*     */ 
/*     */ public class DownLoadFiles
/*     */ {
/*     */   public static void getFlie()
/*     */   {
/*     */     try
/*     */     {
/*  19 */       String url = "D:\\context\\applicationContext-business.xml";
/*     */ 
/*  21 */       String url2 = "D:\\a.xml";
/*  22 */       FileWriter out = new FileWriter(url2);
/*     */ 
/*  24 */       FileReader in = new FileReader(url);
/*  25 */       long num = 0L;
/*     */       int b;
/*  26 */       while ((b = in.read()) != -1)
/*     */       {
/*  28 */         out.write(b);
/*  29 */         num += 1L;
/*     */       }
/*  31 */       in.close();
/*  32 */       out.close();
/*     */     }
/*     */     catch (FileNotFoundException e)
/*     */     {
/*  36 */       e.printStackTrace();
/*  37 */       System.out.println("脦脛录镁脮脪虏禄碌陆");
/*     */     }
/*     */     catch (IOException e) {
/*  40 */       e.printStackTrace();
/*  41 */       System.out.println("脕卢陆脫麓铆脦贸");
/*     */     }
/*     */   }
/*     */ 
/*     */   public static void getFile2() {
/*  46 */     String url = "D:\\context\\applicationContext-business.xml";
/*  47 */     String url1 = "D:\\bbb.xml";
/*     */     try
/*     */     {
/*  50 */       BufferedReader bin = new BufferedReader(new FileReader(url));
/*     */ 
/*  52 */       BufferedWriter bout = new BufferedWriter(new FileWriter(url1));
/*     */ 
/*  54 */       String str = null;
/*  55 */       while ((str = bin.readLine()) != null) {
/*  56 */         bout.write(str);
/*  57 */         bout.newLine();
/*     */       }
/*  59 */       bout.flush();
/*     */ 
/*  61 */       bout.close();
/*     */ 
/*  63 */       bin.close();
/*     */     }
/*     */     catch (FileNotFoundException e)
/*     */     {
/*  67 */       e.printStackTrace();
/*     */     }
/*     */     catch (IOException e) {
/*  70 */       e.printStackTrace();
/*     */     }
/*     */   }
/*     */ 
/*     */   public static void copyFile(File inFile, File file)
/*     */   {
/*     */     try
/*     */     {
/*  82 */       String s = inFile.getAbsolutePath();
/*  83 */       String ss = s.replace("\\", "\\\\");
/*  84 */       String s1 = file.getAbsolutePath();
/*  85 */       String ss1 = s1.replace("\\", "\\\\");
/*  86 */       System.out.println(ss);
/*  87 */       BufferedReader bin = new BufferedReader(new FileReader(ss));
/*     */ 
/*  90 */       BufferedWriter bout = new BufferedWriter(new FileWriter(ss1));
/*  91 */       String str = null;
/*     */ 
/*  93 */       while ((str = bin.readLine()) != null) {
/*  94 */         bout.write(str);
/*  95 */         bout.newLine();
/*     */       }
/*  97 */       bout.flush();
/*  98 */       bout.close();
/*  99 */       bin.close();
/*     */     } catch (FileNotFoundException e) {
/* 101 */       e.printStackTrace();
/*     */     }
/*     */     catch (IOException e) {
/* 104 */       e.printStackTrace();
/*     */     }
/*     */   }
/*     */ 
/*     */   public static void getFiles(String fileUrl, String url) {
/* 109 */     File file = new File(fileUrl);
/* 110 */     if (file.isDirectory()) {
/* 111 */       File[] files = file.listFiles();
/* 112 */       for (int i = 0; i < files.length; i++)
/*     */       {
/* 114 */         getFiles(files[i].getAbsolutePath(), "D:\\test\\" + files[i].getName());
/*     */       }
/*     */     }
/*     */     else
/*     */     {
/* 119 */       copyFile(file, new File(url));
/*     */     }
/*     */   }
/*     */ 
/*     */   public static void main(String[] args)
/*     */   {
/* 129 */     File file = new File("D:\\context");
/*     */ 
/* 133 */     String url = "D:\\context";
/* 134 */     getFiles(url, "D:\\test");
/*     */   }
/*     */ }

/* Location:           F:\JavaProjects\FileUtil\bin\
 * Qualified Name:     com.dvnchina.boss.DownLoadFiles
 * JD-Core Version:    0.6.0
 */